<html>
<head><meta charset="utf-8"><title>Hangs/cargo lock contention · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html">Hangs/cargo lock contention</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216270458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216270458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dirkjan Ochtman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216270458">(Nov 10 2020 at 20:35)</a>:</h4>
<p>I'm seeing some issues today where RA processes seem to get stuck for a long time, ostensibly while holding the Cargo lock</p>



<a name="216270581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216270581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dirkjan Ochtman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216270581">(Nov 10 2020 at 20:36)</a>:</h4>
<p>even for quite a bit after closing my VS Code processes, I saw like 5-6 rust-analyzer-mac processes sitting around while the cargo check process I started in another terminal was sitting there waiting for the build lock</p>



<a name="216270606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216270606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dirkjan Ochtman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216270606">(Nov 10 2020 at 20:36)</a>:</h4>
<p>is this a known issue? any recent PRs that could be at fault?</p>



<a name="216270623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216270623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dirkjan Ochtman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216270623">(Nov 10 2020 at 20:36)</a>:</h4>
<p>(I can file an issue if desirable)</p>



<a name="216271264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216271264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216271264">(Nov 10 2020 at 20:41)</a>:</h4>
<p>Was this during the start of the RA?</p>



<a name="216271690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216271690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dirkjan Ochtman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216271690">(Nov 10 2020 at 20:44)</a>:</h4>
<p>I initially saw it happening after using RA for a while I think</p>



<a name="216271708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216271708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dirkjan Ochtman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216271708">(Nov 10 2020 at 20:45)</a>:</h4>
<p>then I was trying to get out of it and reloading my VS Code windows and stuff</p>



<a name="216271865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216271865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216271865">(Nov 10 2020 at 20:46)</a>:</h4>
<p>Might be the same issue as <a href="https://github.com/rust-analyzer/rust-analyzer/issues/4186">https://github.com/rust-analyzer/rust-analyzer/issues/4186</a>. Try running <code>rust-analyzer analysis-stats .</code> in the project</p>



<a name="216272110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216272110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dirkjan Ochtman <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216272110">(Nov 10 2020 at 20:48)</a>:</h4>
<p>Takes about 25s</p>



<a name="216306178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216306178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216306178">(Nov 11 2020 at 04:15)</a>:</h4>
<p><a href="https://www.reddit.com/r/rust/comments/jrpn83/help_with_rustanalyzer_locking_the_build/">https://www.reddit.com/r/rust/comments/jrpn83/help_with_rustanalyzer_locking_the_build/</a></p>



<a name="216317069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216317069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216317069">(Nov 11 2020 at 08:14)</a>:</h4>
<p>We run <code>cargo check</code> when saving files and when loading the project if proc macros are enabled, but it shouldn't actually slow down your console builds except maybe if you run <code>cargo run</code> when opening it. Maybe there's a hung <code>cargo check</code>?</p>



<a name="216317726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216317726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216317726">(Nov 11 2020 at 08:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Hangs.2Fcargo.20lock.20contention/near/216317069">said</a>:</p>
<blockquote>
<p>except maybe if you run cargo run when opening it</p>
</blockquote>
<p>I think that happens a lot on bigger projects</p>



<a name="216317804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216317804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216317804">(Nov 11 2020 at 08:24)</a>:</h4>
<p>definitely on rustc it's a giant problem <a href="https://github.com/rust-lang/rust/issues/76661">https://github.com/rust-lang/rust/issues/76661</a></p>



<a name="216317851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Hangs/cargo%20lock%20contention/near/216317851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Hangs.2Fcargo.20lock.20contention.html#216317851">(Nov 11 2020 at 08:25)</a>:</h4>
<p>(I need to get back to <a href="https://github.com/rust-lang/rust/pull/77779">https://github.com/rust-lang/rust/pull/77779</a>)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>